﻿using System;
using System.Collections.Generic;
using System.Web.UI;
//
using PerceptiveMCAPI;
using PerceptiveMCAPI.Methods;
using PerceptiveMCAPI.Types;
//
namespace PerceptiveMCAPI_Test
{
   public partial class _Default : System.Web.UI.Page
   {
      #region "fields, constants, properties"

      private ApiMethod CurrentMethod
      {
         get
         {
            ApiMethod am = new ApiMethod();
            if ( ViewState["CurrentMethod"] != null )
            {
               am = ViewState["CurrentMethod"] as ApiMethod;
            }
            return am;
         }
         set { ViewState.Add( "CurrentMethod", value ); }
      }
      private List<ApiMethod> _methods;
      private List<ApiMethod> methods
      {
         get
         {
            _methods = new List<ApiMethod>();
            if ( ViewState["methods"] != null )
            {
               _methods = ViewState["methods"] as List<ApiMethod>;
            }
            return _methods;
         }
         set { ViewState.Add( "methods", value ); }
      }

      public string apikey
      { get { return tbApiKey.Text; } set { tbApiKey.Text = value; } }
      public string campaignId
      {
         get
         {
            if ( ViewState["campaignId"] == null ) return "";
            return ViewState["campaignId"].ToString();
         }
         set { ViewState["campaignId"] = value; }
      }
      public string listId
      {
         get
         {
            if ( ViewState["listId"] == null ) return "";
            return ViewState["listId"].ToString();
         }
         set { ViewState["listId"] = value; }
      }

      public string OutType
      { get { return rblOutType.SelectedValue; } }
      public string AccessType
      { get { return rblAccess.SelectedValue; } }
      public string MethodType
      { get { return rblMethodType.SelectedValue; } }

      public string result_ToString { get; set; }

      #endregion

      //============================================================================
      protected void Page_Load( object sender, EventArgs e )
      {
         if ( !Page.IsPostBack )
         {
            pnlResponse.Visible = false;
            LoadApiMethods();
            LoadAppDefaults();
         }
      }
      // ===========================================================================
      protected void btnTest_Click( object sender, EventArgs e )
      {
         string method = ddlMethods.SelectedValue;
         TestMethod( method );
      }
      protected void btnSettings_Click( object sender, EventArgs e )
      {
         HideItAll();
         ddlMethods.SelectedIndex = -1;
         pnlResponse.Visible = true;
         show_API_Settings1.ShowApiSettings();
      }
      protected void ddlMethods_SelectedIndexChanged( object sender, EventArgs e )
      {
         MethodChange( ddlMethods.SelectedValue );
      }
      protected void rblResponse_SelectedIndexChanged( object sender, EventArgs e )
      {
         ShowResponseOption();
      }
      // ===========================================================================
      private void TestMethod( string method )
      {
         SetupForTest();
         // ----------------------- try it
         try
         {
            switch ( method )
            {
               // -------------------------- Security Related ---------------------------------------
               case "apikeyAdd": mcApikeyAdd(); break;
               case "apikeyExpire": mcApikeyExpire(); break;
               case "apikeys": mcApiKeys(); break;
               // -------------------------- Helper Methods -----------------------------------------
               case "createFolder": mcCreateFolder(); break;
               case "generateText": mcGenerateText(); break;
               case "getAccountDetails": mcGetAccountDetails(); break;
               case "inlineCss": mcInlineCss(); break;
               case "ping": mcPing(); break;
               // MC v1.2.5
               case "chimpChatter": mcChimpChatter(); break;
               case "ecommAddOrder": mcEcommAddOrder(); break;
               case "listsForEmail": mcListsForEmail(); break;

               // --------------------------------- List Related ------------------------------------
               case "lists": mcLists(); break;
               case "listAbuseReports": mcListAbuseReports(); break;
               case "listBatchSubscribe": mcListBatchSubscribe(); break;
               case "listBatchUnsubscribe": mcListBatchUnsubscribe(); break;
               case "listGrowthHistory": mcListGrowthHistory(); break;
               case "listInterestGroupAdd": mcListInterestGroupAdd(); break;
               case "listInterestGroupDel": mcListInterestGroupDel(); break;
               case "listInterestGroupUpdate": mcListInterestGroupUpdate(); break;
               case "listInterestGroups": mcListInterestGroups(); break;
               case "listMemberInfo": mcListMemberInfo(); break;
               case "listMembers": mcListMembers(); break;
               case "listMergeVarAdd": mcListMergeVarAdd(); break;
               case "listMergeVarDel": mcListMergeVarDel(); break;
               case "listMergeVarUpdate": mcListMergeVarUpdate(); break;
               case "listMergeVars": mcListMergeVars(); break;
               case "listSubscribe": mcListSubscribe(); break;
               case "listUnsubscribe": mcListUnsubscribe(); break;
               case "listUpdateMember": mcListUpdateMember(); break;
               case "listWebhookAdd": mcListWebhookAdd(); break;
               case "listWebhookDel": mcListWebhookDel(); break;
               case "listWebhooks": mcListWebhooks(); break;
               // MC v1.2.6 
               case "listInterestGroupings": mc_listInterestGroupings(); break;
               case "listInterestGroupingAdd": mc_listInterestGroupingAdd(); break;
               case "listInterestGroupingUpdate": mc_listInterestGroupingUpdate(); break;
               case "listInterestGroupingDel": mc_listInterestGroupingDel(); break;
               // MC v1.2.7
               case "listAddStaticSegment": mc_listAddStaticSegment(); break;
               case "listDelStaticSegment": mc_listDelStaticSegment(); break;
               case "listResetStaticSegment": mc_listResetStaticSegment(); break;
               case "listStaticSegmentAddMembers": mc_listStaticSegmentAddMembers(); break;
               case "listStaticSegmentDelMembers": mc_listStaticSegmentDelMembers(); break;
               case "listStaticSegments": mc_listStaticSegments(); break;
               // ----------------------- Campaign Related Info & Management --------------------------
               case "campaigns": mcCampaigns(); break;
               case "campaignContent": mcCampaignContent(); break;
               case "campaignCreate": mcCampaignCreate(); break;
               case "campaignDelete": mcCampaignDelete(); break;
               case "campaignEcommAddOrder": mcCampaignEcommAddOrder(); break;
               case "campaignFolders": mcCampaignFolders(); break;
               case "campaignPause": mcCampaignPause(); break;
               case "campaignReplicate": mcCampaignReplicate(); break;
               case "campaignResume": mcCampaignResume(); break;
               case "campaignSchedule": mcCampaignSchedule(); break;
               case "campaignSegmentTest": mcCampaignSegmentTest(); break;
               case "campaignSendNow": mcCampaignSendNow(); break;
               case "campaignSendTest": mcCampaignSendTest(); break;
               case "campaignShareReport": mcCampaignShareReport(); break;
               case "campaignTemplates": mcCampaignTemplates(); break;
               case "campaignUnschedule": mcCampaignUnschedule(); break;
               case "campaignUpdate": mcCampaignUpdate(); break;
               // ------------------------------- Campaign Statistics ---------------------------------
               case "campaignAbuseReports": mcCampaignAbuseReports(); break;
               case "campaignAdvice": mcCampaignAdvice(); break;
               case "campaignAnalytics": mcCampaignAnalytics(); break;
               case "campaignBounceMessages": mcCampaignBounceMessages(); break;
               case "campaignClickStats": mcCampaignClickStats(); break;
               case "campaignEcommOrders": mcCampaignEcommOrders(); break;
               case "campaignEmailDomainPerformance": mcCampaignEmailDomainPerformance(); break;
               case "campaignHardBounces": mcCampaignHardBounces(); break;
               case "campaignSoftBounces": mcCampaignSoftBounces(); break;
               case "campaignStats": mcCampaignStats(); break;
               case "campaignUnsubscribes": mcCampaignUnsubscribes(); break;
               // MC v1.2.5
               case "campaignEepUrlStats": mcCampaignEepUrlStats(); break;
               case "campaignGeoOpens": mcCampaignGeoOpens(); break;
               case "campaignGeoOpensForCountry": mcCampaignGeoOpensForCountry(); break;

               // ------------------------------- Campaign AIM ----------------------------------------
               case "campaignClickDetailAIM": mcCampaignClickDetailAIM(); break;
               case "campaignEmailStatsAIM": mcCampaignEmailStatsAIM(); break;
               case "campaignEmailStatsAIMAll": mcCampaignEmailStatsAIMAll(); break;
               case "campaignNotOpenedAIM": mcCampaignNotOpenedAIM(); break;
               case "campaignOpenedAIM": mcCampaignOpenedAIM(); break;
               // =====================================================================================
            }
         }
         catch ( Exception ex )
         {
            if ( ex.InnerException != null )
               ex = ex.InnerException;

            List<Api_ValidatorMessage> msgs = new List<Api_ValidatorMessage>();
            Api_ValidatorMessage msg = new Api_ValidatorMessage();
            msg.MessageLevel = EnumValues.MessageLevel.Terminal;
            msg.MessageText = ex.Message + "<br />" + ex.StackTrace;
            msg.PropertyName = "--";
            msgs.Add( msg );
            show_errors1.Display( msgs );
         }
      }
      // ===========================================================================

      #region "Security Functions"

      // ----------------------------------------------------------------------------- mcApiKeys
      private void mcApiKeys()
      {
         apikeysParms parms = new apikeysParms();
         parms.apikey = apikey;
         parms.username = get_SecurityParms1.username;
         parms.password = get_SecurityParms1.password;
         parms.expired = get_SecurityParms1.ShowExpired;
         // ------------------------------------------ 
         apikeysInput input = new apikeysInput( parms );
         input = LoadBaseInput<apikeysInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------ 
         apikeys cmd = new apikeys( input );
         apikeysOutput output = cmd.Execute();
         // ------------------------------------------ 
         show_apikeys1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ----------------------------------------------------------------------------- mcApikeyAdd
      private void mcApikeyAdd()
      {
         apikeyAddInput input = new apikeyAddInput( get_SecurityParms1.username, get_SecurityParms1.password, apikey );
         input = LoadBaseInput<apikeyAddInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------ 
         apikeyAdd cmd = new apikeyAdd( input );
         apikeyAddOutput output = cmd.Execute();
         // ------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );

      }
      // ----------------------------------------------------------------------------- mcApikeyExpire
      private void mcApikeyExpire()
      {
         apikeyExpireInput input = new apikeyExpireInput();
         input = LoadBaseInput<apikeyExpireInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------ 
         input.parms.apikey = apikey;
         input.parms.username = get_SecurityParms1.username;
         input.parms.password = get_SecurityParms1.password;
         input.parms.apikeyToExpire = get_SecurityParms1.apikeyToExpire;
         // ------------------------------------------ 
         apikeyExpire cmd = new apikeyExpire( input );
         apikeyExpireOutput output = cmd.Execute();

         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }

      #endregion

      // ===========================================================================

      #region "Helper Functions"

      // ----------------------------------------------------------------------------- mcChimpChatter
      private void mcChimpChatter()
      {
         chimpChatterInput input = new chimpChatterInput();
         input = LoadBaseInput<chimpChatterInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // parms input
         input.parms.apikey = this.apikey;
         // --------------------------------------------
         chimpChatter cmd = new chimpChatter( input );
         chimpChatterOutput output = cmd.Execute();

         show_chimpChatter1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ----------------------------------------------------------------------------- mcCreateFolder
      private void mcCreateFolder()
      {
         createFolderInput input = new createFolderInput();
         input = LoadBaseInput<createFolderInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // parms input
         input.parms.apikey = this.apikey;
         input.parms.name = get_createFolder1.name;
         // --------------------------------------------
         createFolder cmd = new createFolder( input );
         createFolderOutput output = cmd.Execute();

         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ----------------------------------------------------------------------------- mcEcommAddOrder
      private void mcEcommAddOrder()
      {
         ecommAddOrderInput input = new ecommAddOrderInput();
         input = LoadBaseInput<ecommAddOrderInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // parms input
         input.parms.apikey = this.apikey;
         input.parms.order = get_ecommOrder1.ecommAddOrder;
         // --------------------------------------------
         ecommAddOrder cmd = new ecommAddOrder( input );
         ecommAddOrderOutput output = cmd.Execute();

         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ----------------------------------------------------------------------------- mcGenerateText
      private void mcGenerateText()
      {
         generateTextInput input = new generateTextInput();
         input = LoadBaseInput<generateTextInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -----------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.type = get_generateText1.generateTextType;
         input.parms.content = get_generateText1.content;
         // -----------------------------------------------------------
         generateText cmd = new generateText( input );
         generateTextOutput output = cmd.Execute();

         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ----------------------------------------------------------------------------- mcGetAccountDetails
      private void mcGetAccountDetails()
      {
         getAccountDetailsInput input = new getAccountDetailsInput( apikey );
         input = LoadBaseInput<getAccountDetailsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         //
         // no parms input
         // -------------------------------------------------------------
         getAccountDetails cmd = new getAccountDetails( input );
         getAccountDetailsOutput output = cmd.Execute();
         // -------------------------------------------------------------
         show_getAccountDetails1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ----------------------------------------------------------------------------- mcInlineCss 
      private void mcInlineCss()
      {
         inlineCssInput input = new inlineCssInput();
         input = LoadBaseInput<inlineCssInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------
         input.parms.apikey = apikey;
         input.parms.html = get_inlineCss1.content;
         input.parms.strip_css = get_inlineCss1.strip_css;
         // -------------------------------------------
         inlineCss cmd = new inlineCss( input );
         inlineCssOutput output = cmd.Execute();
         // -------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ----------------------------------------------------------------------------- mcListsForEmail
      private void mcListsForEmail()
      {
         listsForEmailInput input = new listsForEmailInput();
         input = LoadBaseInput<listsForEmailInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // parms input
         input.parms.apikey = this.apikey;
         input.parms.email_address = get_listsForEmail1.email_address;
         // --------------------------------------------
         listsForEmail cmd = new listsForEmail( input );
         listsForEmailOutput output = cmd.Execute();

         show_listsForEmail1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ----------------------------------------------------------------------------- mcPing
      private void mcPing()
      {
         pingInput input = new pingInput( apikey );
         input = LoadBaseInput<pingInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ----------------------------------------
         // no parms input
         ping cmd = new ping( input );
         pingOutput output = cmd.Execute();

         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }

      #endregion

      // ===========================================================================

      #region "List Related Info & Management"

      // ------------------------------------------------------------ mcLists
      private void mcLists()
      {
         listsInput input = new listsInput( apikey );
         input = LoadBaseInput<listsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------
         lists cmd = new lists( input );
         listsOutput output = cmd.Execute();
         // --------------------------------------------
         show_lists1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListAbuseReports
      private void mcListAbuseReports()
      {
         listAbuseReportsParms parms = new listAbuseReportsParms();
         parms.apikey = this.apikey;
         parms.id = get_listAbuseReports1.listId;
         parms.start = get_listAbuseReports1.start;
         parms.limit = get_listAbuseReports1.limit;
         parms.since = get_listAbuseReports1.since;
         this.listId = parms.id;    // next request
         // --------------------------------------------
         listAbuseReportsInput input = new listAbuseReportsInput( parms );
         input = LoadBaseInput<listAbuseReportsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------
         listAbuseReports cmd = new listAbuseReports( input );
         listAbuseReportsOutput output = cmd.Execute();
         // --------------------------------------------
         show_listAbuseReports1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListBatchSubscribe
      private void mcListBatchSubscribe()
      {
         List<Dictionary<string, object>> batch = new List<Dictionary<string, object>>();
         listBatchSubscribeInput input = new listBatchSubscribeInput();
         input = LoadBaseInput<listBatchSubscribeInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------------------- Get parms 
         input.parms.apikey = apikey;
         input.parms.id = get_listBatchSubscribe1.listId;
         input.parms.double_optin = get_listBatchSubscribe1.double_optin;
         input.parms.update_existing = get_listBatchSubscribe1.update_existing;
         input.parms.replace_interests = get_listBatchSubscribe1.replace_interests;
         input.parms.batch = get_listBatchSubscribe1.batch;
         this.listId = input.parms.id;    // next request
         // ------------------------------------------------------------------------------
         listBatchSubscribe cmd = new listBatchSubscribe( input );
         listBatchSubscribeOutput output = cmd.Execute();
         // --------------------------------------------
         show_listBatch1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListBatchUnsubscribe
      private void mcListBatchUnsubscribe()
      {
         listBatchUnsubscribeInput input = new listBatchUnsubscribeInput();
         input = LoadBaseInput<listBatchUnsubscribeInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------------------- Get parms 
         input.parms.apikey = apikey;
         input.parms.id = get_listUnsubscribe1.listId;
         input.parms.delete_member = get_listUnsubscribe1.delete_member;
         input.parms.send_goodbye = get_listUnsubscribe1.send_goodbye;
         input.parms.send_notify = get_listUnsubscribe1.send_notify;
         input.parms.emails = get_listUnsubscribe1.emailList;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listBatchUnsubscribe cmd = new listBatchUnsubscribe( input );
         listBatchUnsubscribeOutput output = cmd.Execute();
         // --------------------------------------------
         show_listBatch1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListGrowthHistory
      private void mcListGrowthHistory()
      {
         listGrowthHistoryInput input = new listGrowthHistoryInput();
         input = LoadBaseInput<listGrowthHistoryInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.id = get_ListIdParm1.listId;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listGrowthHistory cmd = new listGrowthHistory( input );
         listGrowthHistoryOutput output = cmd.Execute();
         // --------------------------------------------
         show_listGrowthHistory1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListInterestGroupAdd
      private void mcListInterestGroupAdd()
      {
         listInterestGroupAddInput input = new listInterestGroupAddInput();
         input = LoadBaseInput<listInterestGroupAddInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- get parms
         input.parms.apikey = apikey;
         input.parms.id = get_listInterestGroups1.listId;
         input.parms.group_name = get_listInterestGroups1.group_name;
         input.parms.grouping_id = get_listInterestGroups1.grouping_id;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listInterestGroupAdd cmd = new listInterestGroupAdd( input );
         listInterestGroupAddOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListInterestGroupDel
      private void mcListInterestGroupDel()
      {
         listInterestGroupDelInput input = new listInterestGroupDelInput();
         input = LoadBaseInput<listInterestGroupDelInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- get parms
         input.parms.apikey = apikey;
         input.parms.id = get_listInterestGroups1.listId;
         input.parms.group_name = get_listInterestGroups1.group_name;
         input.parms.grouping_id = get_listInterestGroups1.grouping_id;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listInterestGroupDel cmd = new listInterestGroupDel( input );
         listInterestGroupDelOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListInterestGroupUpdate
      private void mcListInterestGroupUpdate()
      {
         listInterestGroupUpdateInput input = new listInterestGroupUpdateInput();
         input = LoadBaseInput<listInterestGroupUpdateInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- get parms
         input.parms.apikey = apikey;
         input.parms.id = get_listInterestGroups1.listId;
         input.parms.grouping_id = get_listInterestGroups1.grouping_id;
         input.parms.old_name = get_listInterestGroups1.old_name;
         input.parms.new_name = get_listInterestGroups1.new_name;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listInterestGroupUpdate cmd = new listInterestGroupUpdate( input );
         listInterestGroupUpdateOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListInterestGroups --- DEPRECATED
      private void mcListInterestGroups()
      {
         listInterestGroupsInput input = new listInterestGroupsInput();
         input = LoadBaseInput<listInterestGroupsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- get parms
         input.parms.apikey = apikey;
         input.parms.id = get_listInterestGroups1.listId;
         this.listId = input.parms.id;    // next request
         // -------------------------------------------------------------
         listInterestGroups cmd = new listInterestGroups( input );
         listInterestGroupsOutput output = cmd.Execute();
         // ------------------------------------------------- output
         show_listInterestGroups1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ v1.2.6 changes
      // ------------------------------------------------------------ mc_listInterestGroupings
      private void mc_listInterestGroupings()
      {
         listInterestGroupingsInput input = new listInterestGroupingsInput();
         input = LoadBaseInput<listInterestGroupingsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- get parms
         input.parms.apikey = apikey;
         input.parms.id = get_listInterestGrouping1.listId;
         this.listId = input.parms.id;    // next request
         // -------------------------------------------------------------
         listInterestGroupings cmd = new listInterestGroupings( input );
         listInterestGroupingsOutput output = cmd.Execute();
         // ------------------------------------------------- output
         show_listInterestGroupings1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mc_listInterestGroupingAdd
      private void mc_listInterestGroupingAdd()
      {
         listInterestGroupingAddInput input = new listInterestGroupingAddInput();
         input = this.LoadBaseInput<listInterestGroupingAddInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- get parms
         input.parms.apikey = apikey;
         input.parms.id = get_listInterestGrouping1.listId;
         input.parms.name = get_listInterestGrouping1.grouping_name;
         input.parms.type = get_listInterestGrouping1.grouping_type;
         input.parms.groups = get_listInterestGrouping1.grouping_groups;
         // -------------------------------------------------------------
         listInterestGroupingAdd cmd = new listInterestGroupingAdd( input );
         listInterestGroupingAddOutput output = cmd.Execute();
         // ------------------------------------------------- output
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         //
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mc_listInterestGroupingUpdate
      private void mc_listInterestGroupingUpdate()
      {
         listInterestGroupingUpdateInput input = new listInterestGroupingUpdateInput();
         input = this.LoadBaseInput<listInterestGroupingUpdateInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- get parms
         input.parms.apikey = apikey;
         input.parms.grouping_id = get_listInterestGrouping1.grouping_id;
         input.parms.name = get_listInterestGrouping1.grouping_upd_name;
         input.parms.value = get_listInterestGrouping1.grouping_upd_value;
         // -------------------------------------------------------------
         listInterestGroupingUpdate cmd = new listInterestGroupingUpdate( input );
         listInterestGroupingUpdateOutput output = cmd.Execute();
         // ------------------------------------------------- output
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         //
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mc_listInterestGroupingDel
      private void mc_listInterestGroupingDel()
      {
         listInterestGroupingDelInput input = new listInterestGroupingDelInput();
         input = this.LoadBaseInput<listInterestGroupingDelInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- get parms
         input.parms.apikey = apikey;
         input.parms.grouping_id = get_listInterestGrouping1.grouping_id;
         // -------------------------------------------------------------
         listInterestGroupingDel cmd = new listInterestGroupingDel( input );
         listInterestGroupingDelOutput output = cmd.Execute();
         // ------------------------------------------------- output
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         //
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }

      // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

      // ------------------------------------------------------------ mcListMemberInfo
      private void mcListMemberInfo()
      {
         listMemberInfoInput input = new listMemberInfoInput();
         input = LoadBaseInput<listMemberInfoInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- Get Parms
         input.parms.apikey = apikey;
         input.parms.id = get_listMembers1.listId;
         input.parms.email_address = get_listMembers1.email_address;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listMemberInfo cmd = new listMemberInfo( input );
         listMemberInfoOutput output = cmd.Execute();
         // --------------------------------------------------------------
         show_listMemberInfo1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListMembers
      private void mcListMembers()
      {
         listMembersInput input = new listMembersInput();
         input = LoadBaseInput<listMembersInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- Get Parms
         input.parms.apikey = apikey;
         input.parms.id = get_listMembers1.listId;
         input.parms.status = get_listMembers1.member_status;
         input.parms.since = get_listMembers1.since;
         input.parms.start = get_listMembers1.start;
         input.parms.limit = get_listMembers1.limit;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listMembers cmd = new listMembers( input );
         listMembersOutput output = cmd.Execute();
         PerceptiveMCAPI.apiXmlRpc.DestroyProxy();
         // --------------------------------------------
         show_listMembers1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListMergeVarAdd
      private void mcListMergeVarAdd()
      {
         listMergeVarAddInput input = new listMergeVarAddInput();
         input = LoadBaseInput<listMergeVarAddInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listMergeVars1.listId;
         input.parms.tag = get_listMergeVars1.tag;
         input.parms.name = get_listMergeVars1.name;
         input.parms.options = get_listMergeVars1.options; 
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listMergeVarAdd cmd = new listMergeVarAdd( input );
         listMergeVarAddOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListMergeVarDel
      private void mcListMergeVarDel()
      {
         listMergeVarDelInput input = new listMergeVarDelInput();
         input = LoadBaseInput<listMergeVarDelInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listMergeVars1.listId;
         input.parms.tag = get_listMergeVars1.tag;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listMergeVarDel cmd = new listMergeVarDel( input );
         listMergeVarDelOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListMergeVarUpdate
      private void mcListMergeVarUpdate()
      {
         listMergeVarUpdateInput input = new listMergeVarUpdateInput();
         input = LoadBaseInput<listMergeVarUpdateInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listMergeVars1.listId;
         input.parms.tag = get_listMergeVars1.tag;
         input.parms.options = get_listMergeVars1.options;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listMergeVarUpdate cmd = new listMergeVarUpdate( input );
         listMergeVarUpdateOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListMergeVars
      private void mcListMergeVars()
      {
         listMergeVarsInput input = new listMergeVarsInput();
         input = LoadBaseInput<listMergeVarsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------- get parms
         input.parms.apikey = apikey;
         input.parms.id = get_listMergeVars1.listId;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listMergeVars cmd = new listMergeVars( input );
         listMergeVarsOutput output = cmd.Execute();
         // --------------------------------------------
         show_listMergeVars1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListSubscribe
      private void mcListSubscribe()
      {
         listSubscribeInput input = new listSubscribeInput();
         input = LoadBaseInput<listSubscribeInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listSubscribe1.listId;
         input.parms.email_address = get_listSubscribe1.email_address;
         input.parms.email_type = get_listSubscribe1.email_type;
         input.parms.double_optin = get_listSubscribe1.double_optin;
         input.parms.update_existing = get_listSubscribe1.update_existing;
         input.parms.replace_interests = get_listSubscribe1.replace_interests;
         input.parms.send_welcome = get_listSubscribe1.send_welcome;
         input.parms.merge_vars = get_listSubscribe1.merge_vars;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listSubscribe cmd = new listSubscribe( input );
         listSubscribeOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListUnsubscribe
      private void mcListUnsubscribe()
      {
         listUnsubscribeInput input = new listUnsubscribeInput();
         input = LoadBaseInput<listUnsubscribeInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------------------- Get parms 
         input.parms.apikey = apikey;
         input.parms.id = get_listUnsubscribe1.listId;
         input.parms.email_address = get_listUnsubscribe1.email_address;
         input.parms.delete_member = get_listUnsubscribe1.delete_member;
         input.parms.send_goodbye = get_listUnsubscribe1.send_goodbye;
         input.parms.send_notify = get_listUnsubscribe1.send_notify;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------
         listUnsubscribe cmd = new listUnsubscribe( input );
         listUnsubscribeOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListUpdateMember
      private void mcListUpdateMember()
      {
         listUpdateMemberInput input = new listUpdateMemberInput();
         input = LoadBaseInput<listUpdateMemberInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listSubscribe1.listId;
         input.parms.email_address = get_listSubscribe1.email_address;
         input.parms.email_type = get_listSubscribe1.email_type;
         input.parms.replace_interests = get_listSubscribe1.replace_interests;
         input.parms.merge_vars = get_listSubscribe1.merge_vars;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listUpdateMember cmd = new listUpdateMember( input );
         listUpdateMemberOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListWebhookAdd
      private void mcListWebhookAdd()
      {
         listWebhookAddInput input = new listWebhookAddInput();
         input = LoadBaseInput<listWebhookAddInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listWebhooks1.listId;
         input.parms.url = get_listWebhooks1.url;
         input.parms.webhook_actions = get_listWebhooks1.actions;
         input.parms.webhook_sources = get_listWebhooks1.sources;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listWebhookAdd cmd = new listWebhookAdd( input );
         listWebhookAddOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListWebhookDel
      private void mcListWebhookDel()
      {
         listWebhookDelInput input = new listWebhookDelInput();
         input = LoadBaseInput<listWebhookDelInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listWebhooks1.listId;
         input.parms.url = get_listWebhooks1.url;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listWebhookDel cmd = new listWebhookDel( input );
         listWebhookDelOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mcListWebhooks
      private void mcListWebhooks()
      {
         listWebhooksInput input = new listWebhooksInput();
         input = LoadBaseInput<listWebhooksInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listWebhooks1.listId;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listWebhooks cmd = new listWebhooks( input );
         listWebhooksOutput output = cmd.Execute();
         // --------------------------------------------
         show_listWebhooks1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }

      // ------------------------------------------------------------ mc_listAddStaticSegment
      private void mc_listAddStaticSegment()
      {
         listAddStaticSegmentInput input = new listAddStaticSegmentInput();
         input = LoadBaseInput<listAddStaticSegmentInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listStaticSegment1.listId;
         input.parms.name = get_listStaticSegment1.name;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listAddStaticSegment cmd = new listAddStaticSegment( input );
         listAddStaticSegmentOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mc_listDelStaticSegment
      private void mc_listDelStaticSegment()
      {
         listDelStaticSegmentInput input = new listDelStaticSegmentInput();
         input = LoadBaseInput<listDelStaticSegmentInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listStaticSegment1.listId;
         input.parms.seg_id = get_listStaticSegment1.seg_id;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listDelStaticSegment cmd = new listDelStaticSegment( input );
         listDelStaticSegmentOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mc_listResetStaticSegment
      private void mc_listResetStaticSegment()
      {
         listResetStaticSegmentInput input = new listResetStaticSegmentInput();
         input = LoadBaseInput<listResetStaticSegmentInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listStaticSegment1.listId;
         input.parms.seg_id = get_listStaticSegment1.seg_id;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listResetStaticSegment cmd = new listResetStaticSegment( input );
         listResetStaticSegmentOutput output = cmd.Execute();
         // --------------------------------------------
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mc_listStaticSegmentAddMembers
      private void mc_listStaticSegmentAddMembers()
      {
         listStaticSegmentAddMembersInput input = new listStaticSegmentAddMembersInput();
         input = LoadBaseInput<listStaticSegmentAddMembersInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listStaticSegment1.listId;
         input.parms.seg_id = get_listStaticSegment1.seg_id;
         input.parms.batch = get_listStaticSegment1.batch;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listStaticSegmentAddMembers cmd = new listStaticSegmentAddMembers( input );
         listStaticSegmentAddMembersOutput output = cmd.Execute();
         // --------------------------------------------
         show_listStaticSegmentMembers1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mc_listStaticSegmentDelMembers
      private void mc_listStaticSegmentDelMembers()
      {
         listStaticSegmentDelMembersInput input = new listStaticSegmentDelMembersInput();
         input = LoadBaseInput<listStaticSegmentDelMembersInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listStaticSegment1.listId;
         input.parms.seg_id = get_listStaticSegment1.seg_id;
         input.parms.batch = get_listStaticSegment1.batch;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listStaticSegmentDelMembers cmd = new listStaticSegmentDelMembers( input );
         listStaticSegmentDelMembersOutput output = cmd.Execute();
         // --------------------------------------------
         show_listStaticSegmentMembers1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------ mc_listStaticSegments
      private void mc_listStaticSegments()
      {
         listStaticSegmentsInput input = new listStaticSegmentsInput();
         input = LoadBaseInput<listStaticSegmentsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // --------------------------------------------------------
         input.parms.apikey = apikey;
         input.parms.id = get_listStaticSegment1.listId;
         this.listId = input.parms.id;    // next request
         // --------------------------------------------------------
         listStaticSegments cmd = new listStaticSegments( input );
         listStaticSegmentsOutput output = cmd.Execute();
         // --------------------------------------------

         show_listStaticSegments1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }


      // ===========================================================================

      #endregion

      // ===========================================================================

      #region "Campaign Related Info & Management"

      // ------------------------------------------------------------------ mcCampaigns
      private void mcCampaigns()
      {
         campaignsInput input = new campaignsInput();
         input = LoadBaseInput<campaignsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // -------------------------------------------------------------- parms
         input.parms.apikey = this.apikey;
         input.parms.filters = get_campaigns1.filters;
         input.parms.start = get_campaigns1.start;
         input.parms.limit = get_campaigns1.limit;
         // --------------------------------------------------------------
         campaigns cmd = new campaigns( input );
         campaignsOutput output = cmd.Execute();
         // --------------------------------------------
         show_campaigns1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignContent
      private void mcCampaignContent()
      {
         campaignContentInput input = new campaignContentInput();
         input = LoadBaseInput<campaignContentInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_CampaignGenericParms1.campaignId;
         input.parms.for_archive = get_CampaignGenericParms1.campaignContent_for_archive;
         this.campaignId = input.parms.cid;
         // ------------------------------------------------
         campaignContent cmd = new campaignContent( input );
         campaignContentOutput output = cmd.Execute();

         show_campaignContent1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignCreate
      private void mcCampaignCreate()
      {
         campaignCreateInput input = new campaignCreateInput();
         input = LoadBaseInput<campaignCreateInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.type = get_campaignCreate1.campaignType;
         input.parms.options = get_campaignCreate1.options;
         input.parms.content = get_campaignCreate1.content;
         input.parms.segment_opts = get_campaignCreate1.segment_opts;
         input.parms.type_opts = get_campaignCreate1.type_opts;
         // ------------------------------------------------
         campaignCreate cmd = new campaignCreate( input );
         campaignCreateOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         this.campaignId = output.result;    // use new as default

         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignDelete
      private void mcCampaignDelete()
      {
         campaignDeleteInput input = new campaignDeleteInput();
         input = LoadBaseInput<campaignDeleteInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_CampaignGenericParms1.campaignId;
         // ------------------------------------------------
         campaignDelete cmd = new campaignDelete( input );
         campaignDeleteOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignEcommAddOrder -- not implemented
      private void mcCampaignEcommAddOrder()
      {
         campaignEcommAddOrderInput input = new campaignEcommAddOrderInput();
         input = LoadBaseInput<campaignEcommAddOrderInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------------------ 
         input.parms.apikey = this.apikey;
         input.parms.order = get_ecommOrder1.campaignEcommAddOrder;
         // ------------------------------------------------------------ 
         campaignEcommAddOrder cmd = new campaignEcommAddOrder( input );
         campaignEcommAddOrderOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignFolders
      private void mcCampaignFolders()
      {
         campaignFoldersInput input = new campaignFoldersInput( apikey );
         input = LoadBaseInput<campaignFoldersInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------------------ 
         campaignFolders cmd = new campaignFolders( input );
         campaignFoldersOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_campaignFolders1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignPause
      private void mcCampaignPause()
      {
         campaignPauseInput input = new campaignPauseInput();
         input = LoadBaseInput<campaignPauseInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_CampaignGenericParms1.campaignId;
         this.campaignId = input.parms.cid;
         // ------------------------------------------------
         campaignPause cmd = new campaignPause( input );
         campaignPauseOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignReplicate
      private void mcCampaignReplicate()
      {
         campaignReplicateInput input = new campaignReplicateInput();
         input = LoadBaseInput<campaignReplicateInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_CampaignGenericParms1.campaignId;
         // ------------------------------------------------
         campaignReplicate cmd = new campaignReplicate( input );
         campaignReplicateOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         this.campaignId = output.result;    // new campaign id as default

         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignResume
      private void mcCampaignResume()
      {
         campaignResumeInput input = new campaignResumeInput();
         input = LoadBaseInput<campaignResumeInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_CampaignGenericParms1.campaignId;
         this.campaignId = input.parms.cid;
         // ------------------------------------------------
         campaignResume cmd = new campaignResume( input );
         campaignResumeOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignSchedule
      private void mcCampaignSchedule()
      {
         campaignScheduleInput input = new campaignScheduleInput();
         input = LoadBaseInput<campaignScheduleInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignSend1.campaignId;
         input.parms.schedule_time = get_campaignSend1.sched_Time;
         input.parms.schedule_time_b = get_campaignSend1.sched_Time_b;
         this.campaignId = input.parms.cid;
         // ------------------------------------------------
         campaignSchedule cmd = new campaignSchedule( input );
         campaignScheduleOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignSegmentTest
      private void mcCampaignSegmentTest()
      {
         campaignSegmentTestInput input = new campaignSegmentTestInput();
         input = LoadBaseInput<campaignSegmentTestInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.list_id = get_campaignSegment1.ListId;
         input.parms.options.match = get_campaignSegment1.Match;
         input.parms.options.conditions = get_campaignSegment1.SegmentConditions;
         // ------------------------------------------------
         campaignSegmentTest cmd = new campaignSegmentTest( input );
         campaignSegmentTestOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignSendNow
      private void mcCampaignSendNow()
      {
         campaignSendNowInput input = new campaignSendNowInput();
         input = LoadBaseInput<campaignSendNowInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignSend1.campaignId;
         this.campaignId = input.parms.cid;
         // ------------------------------------------------
         campaignSendNow cmd = new campaignSendNow( input );
         campaignSendNowOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignSendTest
      private void mcCampaignSendTest()
      {
         campaignSendTestInput input = new campaignSendTestInput();
         input = LoadBaseInput<campaignSendTestInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignSend1.campaignId;
         this.campaignId = input.parms.cid;
         input.parms.send_type = get_campaignSend1.send_type;
         input.parms.test_emails = get_campaignSend1.emails;
         // ------------------------------------------------
         campaignSendTest cmd = new campaignSendTest( input );
         campaignSendTestOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignShareReport
      private void mcCampaignShareReport()
      {
         campaignShareReportInput input = new campaignShareReportInput();
         input = LoadBaseInput<campaignShareReportInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignShareReport1.campaignId;
         input.parms.opts = get_campaignShareReport1.opts;
         this.campaignId = input.parms.cid;
         // ------------------------------------------------
         campaignShareReport cmd = new campaignShareReport( input );
         campaignShareReportOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_campaignShareReport1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignTemplates
      private void mcCampaignTemplates()
      {
         campaignTemplatesInput input = new campaignTemplatesInput( apikey );
         input = LoadBaseInput<campaignTemplatesInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------------------ 
         campaignTemplates cmd = new campaignTemplates( input );
         campaignTemplatesOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_campaignTemplates1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignUnschedule
      private void mcCampaignUnschedule()
      {
         campaignUnscheduleInput input = new campaignUnscheduleInput();
         input = LoadBaseInput<campaignUnscheduleInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignSend1.campaignId;
         this.campaignId = input.parms.cid;
         // ------------------------------------------------
         campaignUnschedule cmd = new campaignUnschedule( input );
         campaignUnscheduleOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------ mcCampaignUpdate
      private void mcCampaignUpdate()
      {
         campaignUpdateInput input = new campaignUpdateInput();
         input = LoadBaseInput<campaignUpdateInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------------------ get parms
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignUpdate1.campaignId;
         input.parms.name = get_campaignUpdate1.name;
         input.parms.value = get_campaignUpdate1.value;
         // ------------------------------------------------------------ 
         campaignUpdate cmd = new campaignUpdate( input );
         campaignUpdateOutput output = cmd.Execute();
         // ------------------------------------------------------------ 
         show_DefaultResponse1.Display( output.result ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      #endregion

      // ===========================================================================

      #region "Campaign Statistics"

      // ------------------------------------------------------------------- mcCampaignAbuseReports
      private void mcCampaignAbuseReports()
      {
         campaignAbuseReportsInput input = new campaignAbuseReportsInput();
         input = LoadBaseInput<campaignAbuseReportsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.since = get_campaignStats1.since;
         input.parms.start = get_campaignStats1.start;
         input.parms.limit = get_campaignStats1.limit;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignAbuseReports cmd = new campaignAbuseReports( input );
         campaignAbuseReportsOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignAbuseReports1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignAdvice
      private void mcCampaignAdvice()
      {
         campaignAdviceInput input = new campaignAdviceInput();
         input = LoadBaseInput<campaignAdviceInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignAdvice cmd = new campaignAdvice( input );
         campaignAdviceOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignAdvice1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignAnalytics
      private void mcCampaignAnalytics()
      {
         campaignAnalyticsInput input = new campaignAnalyticsInput();
         input = LoadBaseInput<campaignAnalyticsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignAnalytics cmd = new campaignAnalytics( input );
         campaignAnalyticsOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignAnalytics1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignBounceMessages
      private void mcCampaignBounceMessages()
      {
         campaignBounceMessagesInput input = new campaignBounceMessagesInput();
         input = LoadBaseInput<campaignBounceMessagesInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.since = get_campaignStats1.since;
         input.parms.start = get_campaignStats1.start;
         input.parms.limit = get_campaignStats1.limit;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignBounceMessages cmd = new campaignBounceMessages( input );
         campaignBounceMessagesOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignBounceMessages1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignClickStats
      private void mcCampaignClickStats()
      {
         campaignClickStatsInput input = new campaignClickStatsInput();
         input = LoadBaseInput<campaignClickStatsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignClickStats cmd = new campaignClickStats( input );
         campaignClickStatsOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignClickStats1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignEcommOrders
      private void mcCampaignEcommOrders()
      {
         campaignEcommOrdersInput input = new campaignEcommOrdersInput();
         input = LoadBaseInput<campaignEcommOrdersInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.start = get_campaignStats1.start;
         input.parms.limit = get_campaignStats1.limit;
         input.parms.since = get_campaignStats1.since;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignEcommOrders cmd = new campaignEcommOrders( input );
         campaignEcommOrdersOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignEcommOrders1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignEepUrlStats
      private void mcCampaignEepUrlStats()
      {
         campaignEepUrlStatsInput input = new campaignEepUrlStatsInput();
         input = LoadBaseInput<campaignEepUrlStatsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // parms input
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         // --------------------------------------------
         campaignEepUrlStats cmd = new campaignEepUrlStats( input );
         campaignEepUrlStatsOutput output = cmd.Execute();

         show_campaignEepUrlStats1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignEmailDomainPerformance
      private void mcCampaignEmailDomainPerformance()
      {
         campaignEmailDomainPerformanceInput input = new campaignEmailDomainPerformanceInput();
         input = LoadBaseInput<campaignEmailDomainPerformanceInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignEmailDomainPerformance cmd = new campaignEmailDomainPerformance( input );
         campaignEmailDomainPerformanceOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignEmailDomainPerformance1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignGeoOpens
      private void mcCampaignGeoOpens()
      {
         campaignGeoOpensInput input = new campaignGeoOpensInput();
         input = LoadBaseInput<campaignGeoOpensInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // parms input
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         this.campaignId = input.parms.cid;  // next req.
         // --------------------------------------------
         campaignGeoOpens cmd = new campaignGeoOpens( input );
         campaignGeoOpensOutput output = cmd.Execute();

         show_campaignGeoOpens1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignGeoOpensForCountry
      private void mcCampaignGeoOpensForCountry()
      {
         campaignGeoOpensForCountryInput input = new campaignGeoOpensForCountryInput();
         input = LoadBaseInput<campaignGeoOpensForCountryInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // parms input
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.code = get_campaignStats1.country_code;
         this.campaignId = input.parms.cid;  // next req.
         // --------------------------------------------
         campaignGeoOpensForCountry cmd = new campaignGeoOpensForCountry( input );
         campaignGeoOpensForCountryOutput output = cmd.Execute();

         show_campaignGeoOpensForCountry1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignHardBounces
      private void mcCampaignHardBounces()
      {
         campaignHardBouncesInput input = new campaignHardBouncesInput();
         input = LoadBaseInput<campaignHardBouncesInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.start = get_campaignStats1.start;
         input.parms.limit = get_campaignStats1.limit;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignHardBounces cmd = new campaignHardBounces( input );
         campaignHardBouncesOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignStatsEmail1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignSoftBounces
      private void mcCampaignSoftBounces()
      {
         campaignSoftBouncesInput input = new campaignSoftBouncesInput();
         input = LoadBaseInput<campaignSoftBouncesInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.start = get_campaignStats1.start;
         input.parms.limit = get_campaignStats1.limit;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignSoftBounces cmd = new campaignSoftBounces( input );
         campaignSoftBouncesOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignStatsEmail1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignStats
      private void mcCampaignStats()
      {
         campaignStatsInput input = new campaignStatsInput();
         input = LoadBaseInput<campaignStatsInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignStats cmd = new campaignStats( input );
         campaignStatsOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignStats1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // ------------------------------------------------------------------- mcCampaignUnsubscribes
      private void mcCampaignUnsubscribes()
      {
         campaignUnsubscribesInput input = new campaignUnsubscribesInput();
         input = LoadBaseInput<campaignUnsubscribesInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.start = get_campaignStats1.start;
         input.parms.limit = get_campaignStats1.limit;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignUnsubscribes cmd = new campaignUnsubscribes( input );
         campaignUnsubscribesOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignStatsEmail1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }

      #endregion

      // ===========================================================================

      #region "Campaign AIM Report Functions"

      // --------------------------------------------------------------- mcCampaignClickDetailAIM 
      private void mcCampaignClickDetailAIM()
      {
         campaignClickDetailAIMInput input = new campaignClickDetailAIMInput();
         input = LoadBaseInput<campaignClickDetailAIMInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.start = get_campaignStats1.start;
         input.parms.limit = get_campaignStats1.limit;
         input.parms.url = get_campaignStats1.url;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignClickDetailAIM cmd = new campaignClickDetailAIM( input );
         campaignClickDetailAIMOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignClickDetailAIM1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // --------------------------------------------------------------- mcCampaignEmailStatsAIM 
      private void mcCampaignEmailStatsAIM()
      {
         campaignEmailStatsAIMInput input = new campaignEmailStatsAIMInput();
         input = LoadBaseInput<campaignEmailStatsAIMInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.email_address = get_campaignStats1.email_address;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignEmailStatsAIM cmd = new campaignEmailStatsAIM( input );
         campaignEmailStatsAIMOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignEmailStatsAIM1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // --------------------------------------------------------------- mcCampaignEmailStatsAIMAll 
      private void mcCampaignEmailStatsAIMAll()
      {
         campaignEmailStatsAIMAllInput input = new campaignEmailStatsAIMAllInput();
         input = LoadBaseInput<campaignEmailStatsAIMAllInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.start = get_campaignStats1.start;
         input.parms.limit = get_campaignStats1.limit;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignEmailStatsAIMAll cmd = new campaignEmailStatsAIMAll( input );
         campaignEmailStatsAIMAllOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignEmailStatsAIMAll1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // --------------------------------------------------------------- mcCampaignOpenedAIM 
      private void mcCampaignOpenedAIM()
      {
         campaignOpenedAIMInput input = new campaignOpenedAIMInput();
         input = LoadBaseInput<campaignOpenedAIMInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.start = get_campaignStats1.start;
         input.parms.limit = get_campaignStats1.limit;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignOpenedAIM cmd = new campaignOpenedAIM( input );
         campaignOpenedAIMOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignOpenedAIM1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }
      // --------------------------------------------------------------- mcCampaignNotOpenedAIM 
      private void mcCampaignNotOpenedAIM()
      {
         campaignNotOpenedAIMInput input = new campaignNotOpenedAIMInput();
         input = LoadBaseInput<campaignNotOpenedAIMInput>( input, AccessType, OutType, MethodType, cbEncode.Checked, cbValidate.Checked );
         // ------------------------------------------------
         input.parms.apikey = this.apikey;
         input.parms.cid = get_campaignStats1.campaignId;
         input.parms.start = get_campaignStats1.start;
         input.parms.limit = get_campaignStats1.limit;
         this.campaignId = input.parms.cid;  // next req.
         // ------------------------------------------------
         campaignNotOpenedAIM cmd = new campaignNotOpenedAIM( input );
         campaignNotOpenedAIMOutput output = cmd.Execute();
         // ------------------------------------------------
         show_campaignStatsEmail1.Display( output ); this.result_ToString = output.ToString();
         if ( input.api_AccessType == EnumValues.AccessType.XmlRpc )
            output.api_Request = apiXmlRpcRequestDisplayFormat.FormatParms( output.inputParms );
         showResults( output.api_Request, output.api_Response,
            output.api_ErrorMessages, output.api_ValidatorMessages );
      }

      #endregion

      // ===========================================================================

      #region "Show Results / Errors / Options"

      private void showResults( string request, string response,
         List<Api_Error> apiErrors, List<Api_ValidatorMessage> valMessages )
      {
         // -- request
         show_API_Request1.api_Request = request;
         show_API_Request1.Display();
         // -- response
         show_API_Response1.api_UnformattedResponse = response;
         show_API_Response1.api_ResponseToString = this.result_ToString;
         ShowResponseOption();
         // -- errors
         show_errors1.Display( apiErrors, valMessages );
      }

      private void ShowResponseOption()
      {
         // formatted response
         if ( rblResponseFormatted.SelectedValue.ToLower() == "noshow" )
         {
            show_API_Response1.Show_Formatted = false;
            show_API_Response1.Show_ToString = false;
         }
         else if ( rblResponseFormatted.SelectedValue.ToLower() == "tostring" )
         {
            show_API_Response1.Show_Formatted = false;
            show_API_Response1.Show_ToString = true;
         }
         else
         {
            show_API_Response1.Show_Formatted = true;
            show_API_Response1.Show_ToString = false;
         }

         // Unformatted response
         if ( rblResponseUnformatted.SelectedValue.ToLower() == "noshow" )
            show_API_Response1.Show_Unformatted = false;
         else
            show_API_Response1.Show_Unformatted = true;
         // length for serial
         if ( this.rblAccess.SelectedValue == EnumValues.AccessType.Serial.ToString() )
            show_API_Response1.api_ResponseLength =
           string.Format( "[{0}]", show_API_Response1.api_UnformattedResponse.Length );
         else
            show_API_Response1.api_ResponseLength = "";
         // -- show & tell
         show_API_Response1.Display();
      }
      // 
      #endregion

      // --------------------------------------------------------------------------------------
      #region "Misc. Support Functions"

      private void MethodChange( string method )
      {
         HideItAll();

         CurrentMethod = methods.Find( m => m.name == method );
         //-------------------------------------------------------------------- None
         if ( CurrentMethod.panelInput == "noparms" )
         {
            get_NoParms1.method = CurrentMethod;
            get_NoParms1.Setup();
         }
         //-------------------------------------------------------------------- Helper & Security
         else if ( CurrentMethod.panelInput == "security" )
         {
            get_SecurityParms1.method = CurrentMethod;
            get_SecurityParms1.Setup();
         }
         else if ( CurrentMethod.panelInput == "createFolder" )
         {
            get_createFolder1.method = CurrentMethod;
            get_createFolder1.Setup();
         }
         else if ( CurrentMethod.panelInput == "inlineCss" )
         {
            get_inlineCss1.method = CurrentMethod;
            get_inlineCss1.Setup();
         }
         else if ( CurrentMethod.panelInput == "generateText" )
         {
            get_generateText1.method = CurrentMethod;
            get_generateText1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listsForEmail" )
         {
            get_listsForEmail1.method = CurrentMethod;
            get_listsForEmail1.Setup();
         }

         //--------------------------------------------------------------------
         else if ( CurrentMethod.panelInput == "campaignList" )
         {
            get_campaigns1.method = CurrentMethod;
            get_campaigns1.Setup();
         }
         else if ( CurrentMethod.panelInput == "campaignStats" )
         {
            get_campaignStats1.method = CurrentMethod;
            get_campaignStats1.campaignId = this.campaignId;
            get_campaignStats1.Setup();
         }
         else if ( CurrentMethod.panelInput == "campaign" )
         {
            get_CampaignGenericParms1.method = CurrentMethod;
            get_CampaignGenericParms1.campaignId = this.campaignId;
            get_CampaignGenericParms1.Setup();
         }
         else if ( CurrentMethod.panelInput == "campaignSend" )
         {
            get_campaignSend1.method = CurrentMethod;
            get_campaignSend1.campaignId = this.campaignId;
            get_campaignSend1.Setup();
         }
         else if ( CurrentMethod.panelInput == "campaignCreate" )
         {
            get_campaignCreate1.method = CurrentMethod;
            get_campaignCreate1.ListId = this.listId;
            get_campaignCreate1.Setup();
         }
         else if ( CurrentMethod.panelInput == "campaignUpdate" )
         {
            get_campaignUpdate1.method = CurrentMethod;
            get_campaignUpdate1.campaignId = this.campaignId;
            get_campaignUpdate1.Setup();
         }
         else if ( CurrentMethod.panelInput == "campaignSegment" )
         {
            get_campaignSegment1.method = CurrentMethod;
            get_campaignSegment1.ListId = this.listId;
            get_campaignSegment1.Setup();
         }
         else if ( CurrentMethod.panelInput == "ecommAddOrder" )
         {
            get_ecommOrder1.method = CurrentMethod;
            get_ecommOrder1.Setup();
         }
         else if ( CurrentMethod.panelInput == "campaignShareReport" )
         {
            get_campaignShareReport1.method = CurrentMethod;
            get_campaignShareReport1.campaignId = this.campaignId;
            get_campaignShareReport1.Setup();
         }
         //-------------------------------------------------------------------- List Related
         else if ( CurrentMethod.panelInput == "listMembers" )
         {
            get_listMembers1.method = CurrentMethod;
            get_listMembers1.listId = this.listId;
            get_listMembers1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listAbuse" )
         {
            get_listAbuseReports1.method = CurrentMethod;
            get_listAbuseReports1.listId = this.listId;
            get_listAbuseReports1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listIdOnly" )
         {
            get_ListIdParm1.method = CurrentMethod;
            get_ListIdParm1.listId = this.listId;
            get_ListIdParm1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listInterest" )
         {
            get_listInterestGroups1.method = CurrentMethod;
            get_listInterestGroups1.listId = this.listId;
            get_listInterestGroups1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listMergeVars" )
         {
            get_listMergeVars1.method = CurrentMethod;
            get_listMergeVars1.listId = this.listId;
            get_listMergeVars1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listInterestGrouping" )
         {
            get_listInterestGrouping1.method = CurrentMethod;
            get_listInterestGrouping1.listId = this.listId;
            get_listInterestGrouping1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listBatchSubscribe" )
         {
            get_listBatchSubscribe1.method = CurrentMethod;
            get_listBatchSubscribe1.listId = this.listId;
            get_listBatchSubscribe1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listSubscribe" )
         {
            get_listSubscribe1.method = CurrentMethod;
            get_listSubscribe1.listId = this.listId;
            get_listSubscribe1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listUnsubscribe" )
         {
            get_listUnsubscribe1.method = CurrentMethod;
            get_listUnsubscribe1.listId = this.listId;
            get_listUnsubscribe1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listWebhooks" )
         {
            get_listWebhooks1.method = CurrentMethod;
            get_listWebhooks1.listId = this.listId;
            get_listWebhooks1.Setup();
         }
         else if ( CurrentMethod.panelInput == "listStaticSegment" )
         {
            get_listStaticSegment1.method = CurrentMethod;
            get_listStaticSegment1.listId = this.listId;
            get_listStaticSegment1.Setup();
         }

         pnlRequest.Visible = true;
      }
      private void HideItAll()
      {
         // ---------------------------------------- clear previous
         show_API_Request1.Hide();
         show_API_Response1.Hide();
         pnlRequest.Visible = false;
         pnlResponse.Visible = false;
         show_errors1.Visible = false;
         // --------------------------------------------- GET
         foreach ( Control ctl in pnlRequest.Controls )
         {
            if ( ctl.GetType().Name.EndsWith( "ascx" ) )
               ctl.Visible = false;
         }
         // --------------------------------------------- SHOW
         foreach ( Control ctl in pnlResponse.Controls )
         {
            if ( ctl.GetType().Name.EndsWith( "ascx" ) )
               ctl.Visible = false;
         }
      }
      private void SetupForTest()
      {
         // ---------------------------------------- format values from page
         show_API_Request1.api_Request = "";
         show_API_Request1.Display();

         show_errors1.Visible = false;
         //
         string accXmlRpc = EnumValues.AccessType.XmlRpc.ToString();
         string outXmlRpc = EnumValues.OutputType.XmlRpc.ToString();

         if ( rblAccess.SelectedValue == accXmlRpc )
         { rblOutType.SelectedValue = outXmlRpc; }
         else if ( rblAccess.SelectedValue != accXmlRpc
       && rblOutType.SelectedValue == outXmlRpc )
            rblOutType.SelectedValue = EnumValues.OutputType.JSON.ToString();

         if ( rblOutType.SelectedValue == EnumValues.OutputType.PHP.ToString() )
         { rblResponseUnformatted.SelectedValue = "show"; rblResponseFormatted.SelectedValue = "noshow"; }
         else if ( rblOutType.SelectedValue == outXmlRpc )
            rblResponseUnformatted.SelectedValue = "noshow";
      }

      private T LoadBaseInput<T>( T input_type, string AccessType, string OutType, string MethodType, bool Encode, bool Validate )
      {
         Api_BaseInput input = input_type as Api_BaseInput;
         input.api_AccessType = ApiHelper.GetEnumFromString<EnumValues.AccessType>( AccessType );
         input.api_OutputType = ApiHelper.GetEnumFromString<EnumValues.OutputType>( OutType );
         input.api_MethodType = ApiHelper.GetEnumFromString<EnumValues.MethodType>( MethodType );
         input.api_EncodeRequest = Encode;
         input.api_Validate = Validate;
         //
         return input_type;
      }

      private void LoadApiMethods()
      {
         methods = ApiHelper.GetApiMethods();
         ddlMethods.DataSource = methods;
         ddlMethods.DataTextField = "title";
         ddlMethods.DataValueField = "name";
         ddlMethods.DataBind();
      }
      private void LoadAppDefaults()
      {
         rblAccess.SelectedValue = MCAPISettings.default_AccessType.ToString();
         rblOutType.SelectedValue = MCAPISettings.default_OutputType.ToString();
         rblMethodType.SelectedValue = MCAPISettings.default_MethodType.ToString();
         cbEncode.Checked = MCAPISettings.default_EncodeRequest;
         cbValidate.Checked = MCAPISettings.default_Validate;
         tbApiKey.Text = MCAPISettings.default_apikey;
      }

      #endregion
   }
}
